// 为起床登记模拟数据
require("../models/relation")
const mock = require("mockjs")
const {Getup} = require("../models/Getup")
const {StudentSInfon} = require("../models/StudentSInfon")
const moment = require("moment")


StudentSInfon.findAll({
    attributes:["id"]
}).then(data => {
    const arr = JSON.parse(JSON.stringify(data))
    let StudentSInfonId = []
    arr.forEach(item => {
        let newArr = new Array(1).fill(item.id)
        StudentSInfonId.push(...newArr)
    });
    const GetupList = mock.mock({
        [`datas|${arr.length}`]:[
            {
                "time":+moment.utc(),
                "isGetup|1":[0,1], // 1: 按时起床 0: 未按时起床
                "StudentSInfonId|+1":StudentSInfonId
            }
        ]
    }).datas
    Getup.bulkCreate(GetupList).then(data => {
        console.log(data);
    })
})

